




package com.yinhai.ta404.component.org.core.annotation;

import com.yinhai.ta404.core.exception.AppException;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

@Aspect
@Component
public class TaRequestAuthentication {

    public TaRequestAuthentication() {
    }

    @Before("@annotation(Authentication)")
    public void before(JoinPoint joinPoint) {
        HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
        Object[] args = joinPoint.getArgs();
        boolean flag = false;
        Object[] var5 = args;
        int var6 = args.length;

        if (!flag) {
            throw new AppException("密码错误");
        }
    }
}
